import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';

// 配置接口文档 swager
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { NestExpressApplication } from '@nestjs/platform-express';

async function bootstrap() {
  // const app = await NestFactory.create(AppModule);

  const app = await NestFactory.create<NestExpressApplication>(AppModule);
  app.enableCors();

   // 设置swagger文档
   const config = new DocumentBuilder()
   .setTitle('管理后台')   
   .setDescription('管理后台接口文档')
   .setVersion('1.0')
   .addBearerAuth()
   .build();
 const document = SwaggerModule.createDocument(app, config);
 SwaggerModule.setup('docs', app, document);

  await app.listen(3009);
}
bootstrap();
